#水仙花

class Solution:
    def __init__(self):
        pass


    def run(self,num):
        if   num <= 99 or  num >  999:
            print('输入错误,请重新输入3位数')
        else:
            b = num // 100
            s = (num // 10 ) % 10
            g = num % 10
            if b**3 + s**3 + g **3 == num:
                print(f'{num}：是水仙花数')
            else:
                print(f'{num}：不是水仙花数')


if __name__ == '__main__':
    s = Solution()
    while True:
        num = input('请输入3位数字(n/enter退出)：')
        if num == 'n' or num == "":
            break
        if num.isdigit():
            s.run(int(num))
        else:
            print('请重新输入正确')
